﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using WinformToolkit.Drawing;
using WinformToolkit.Navigations;

namespace WinformToolkitDemo.UserControls
{
    public partial class DrawToolsUserControl : UserControl, IContentControl
    {
        //private WinformToolkit.Drawing.DrawArea drawArea;

        public DrawToolsUserControl()
        {
            InitializeComponent();

            this.InitializeUserControl();
        }

        private void InitializeUserControl()
        {
        }

        private void buttonCursor_Click(object sender, EventArgs e)
        {
            drawArea1.ActiveTool = WinformToolkit.Drawing.DrawArea.DrawToolType.Pointer;
        }

        private void buttonRectangle_Click(object sender, EventArgs e)
        {
            drawArea1.ActiveTool = WinformToolkit.Drawing.DrawArea.DrawToolType.Rectangle;
        }

        private void buttonLoadImage_Click(object sender, EventArgs e)
        {
            drawArea1.LoadImage(new Bitmap(Bitmap.FromFile("Images/1.jpg")));
        }

        private void buttonFlipX_Click(object sender, EventArgs e)
        {
            drawArea1.FlipGraphics(FlipTypeEnum.FlipX);
        }

        private void buttonAddRectangle_Click(object sender, EventArgs e)
        {
            drawArea1.AddGraphics(new PropertiesRectangle(10, 10, 100, 100) { Text = "Rectangle1", FillColor = Color.LightBlue });
            drawArea1.AddGraphics(new PropertiesRectangle(20, 20, 100, 100) { Text = "Rectangle2" });
        }

        private void buttonResetState_Click(object sender, EventArgs e)
        {
            drawArea1.ResetState();
        }
    }
}
